package com.shengyuan.manage_os.old.ying.erpm;

import java.util.ArrayList;
import java.util.List;

import com.shengyuan.manage_os.R;
import com.shengyuan.manage_os.old.ying.erpm.data.MenuItem;
import com.shengyuan.manage_os.old.ying.erpm.layout.Workspace.OnViewChangedListener;
import com.shengyuan.manage_os.old.ying.erpm.tasks.Submit_System_Setting_Data_Task;

import android.content.Intent;
import android.content.res.Resources;
import android.os.Handler;
import android.os.Message;

public class OAActivity extends WorkSpaceActivity implements OnViewChangedListener {

	public static String[] A_GONGCHENGMINGCHENG=Submit_System_Setting_Data_Task.A_GONGCHENGMINGCHENG_OA;
	
//	@Override
//	public void GetProjectDataList() {
//		Submit_System_Setting_Data_Task mSubmitTask = new Submit_System_Setting_Data_Task();
//		mSubmitTask.setListener(mTaskListener);
//		TaskParams params;
//		params = new TaskParams();
//		params.put(Submit_System_Setting_Data_Task.TYPENAME,Submit_System_Setting_Data_Task.T_GONGCHENGMINGCHENG_GC);
//		params.put(Submit_System_Setting_Data_Task.TYPECODE, LoginActivity.pmUser.UserName);
//		mSubmitTask.execute(params);
//	}
	
	@Override
	public List<MenuItem> LoadMenuListItems() 
    {
    	MenuItem item;
    	List<MenuItem> list = new ArrayList<MenuItem>();
    	Resources res =getResources();
    	String[] city=res.getStringArray(R.array.main_menus_oa);
    	for (int i = 0; i < city.length; i++) {
    		item = new MenuItem();
			item.title = city[i];
			item.index = i;
			list.add( item);
		} 
    	return list;
    }

    private Handler mHandler= new Handler(){

		@Override
		public void handleMessage(Message msg) {
			//BaseActivity.A_GONGCHENGMINGCHENG = Submit_System_Setting_Data_Task.A_GONGCHENGMINGCHENG_OA;
			//BaseActivity.A_GONGCHENGMINGCHENG_XIANGMU = Submit_System_Setting_Data_Task.A_GONGCHENGMINGCHENG_OA_XIANGMU;
			Intent intent = new Intent();
            switch (msg.arg1) {
            case 0:
            	intent.setClass(OAActivity.this, Actual_OA_WorkDialy.class);
            	break;
            case 1:
            	intent.setClass(OAActivity.this, Actual_OA_CarBaoXiao.class);
            	break;
            case 2:        	    
            	intent.setClass(OAActivity.this, Actual_GC_CaiGouDan.class);
            	break;
            case 3:
            	intent.setClass(OAActivity.this, Actual_OA_JiDongRenDengJi.class);
            	break;      
            case 4:        	    
            	
            	//intent.setClass(OAActivity.this, Actual_OA_JiDongRenDengJi.class);
            	break;               	
            }
            startActivity(intent);
		}
    	
    };
    @Override
	public boolean IsAllow() {
    	//return LoginActivity.pmUser.JiaoSe.equals("超级管理员") || LoginActivity.pmUser.JiaoSe.equals("行政专员");
    	return true;
	}

	@Override
	public Handler GetHandler() {
		return mHandler;
	}	
}